import { createStore } from "vuex";
import createPersistedState from "vuex-persistedstate"
import SecureLs from "secure-ls"
import day from "./modules/day"
import todo from "./modules/todo"

// 使用加密
var ls = new SecureLs({ isCompression: false});

export default createStore({
    modules:{
        day,
        todo
    },
    plugins: [
        createPersistedState({
            storage: {
                getItem: (key) => ls.get(key),
                setItem: (key, value) => ls.set(key, value),
                removeItem: (key) => ls.remove(key)
            }
        })
    ]
})